package com.bkgy.controller.plateThickAbnormal.controller;

import com.bkgy.commom.model.QueryDTO;
import com.bkgy.controller.plateThickAbnormal.entity.tDefectDataRequst;
import com.bkgy.controller.plateThickAbnormal.entity.tDefectDataRequstCondition;
import com.bkgy.controller.plateThickAbnormal.service.plateThickAbnormalExcel;
import com.bkgy.controller.plateThickAbnormal.service.plateThickAbnormalService;
import com.bkgy.sys.common.entity.ResultData;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@RestController
@RequestMapping("/plateThickAbnormal")
public class plateThickAbnormalController {

    @Autowired
    plateThickAbnormalService   plateThickAbnormalService;

    @Autowired
    plateThickAbnormalExcel plateThickAbnormalExcel;

    @Operation(summary = "酸轧厚度、版型异常明细", description = "酸轧厚度、版型异常明细")
    @PostMapping("/getTdefectDataPage")
    public ResultData getTdefectData_Page(@RequestBody @Valid tDefectDataRequst request)
    {
        return plateThickAbnormalService.getTdefectDataPage(request);
    }


    @Operation(summary = "酸轧厚度、版型异常导出Excel", description = "酸轧厚度、版型异常导出Excel")
    @PostMapping("/DefectDataExcel")
    public void DefectDataExcel(@Parameter(description = "查询条件") @RequestBody @Valid QueryDTO<tDefectDataRequstCondition> queryDTO) {
        plateThickAbnormalExcel.exportplateThick(queryDTO);
    }
}
